<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    function Person (name, age, gender) {
        this.name = name
        this.age = age
        this.gender = gender
        this.sayName = () => {
            console.log(name)
        }
    }
    var person = new Person('tom', '18', '女')   //当作构造函数
    Person('jack', '20', '男')   //当作普通函数，全局作用域（添加到window）
    var o = new Object()    //在另一个对象的作用域中调用
    Person.call(o, 'mary', '20', '女')


</script>

</body>
</html>
